<?php
class M_login extends CI_Model {
	function M_login(){
		parent::__construct();		
		
	}
	//查询1条数据，返回结果
	function query_one($sql){
		$db = $this->connect_database();
		return $db->query($sql)->row_array();
		
	}
	//连接数据库并且返回句柄
	private function connect_database(){
		return  $this->load->database('real_data',true);
	}
	
}